﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title>Binding Test</title>
        <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.4.1.css">
    </head>
    <body>
        <div id="qunit"></div>
        <div id="qunit-fixture"></div>
        <script src="https://code.jquery.com/qunit/qunit-2.4.1.js"></script>

        <script type="text/javascript">
        (async () =>
        {
            await CefSharp.BindObjectAsync("boundAsync", "bound");

            QUnit.test( "Struct Test:", function( assert )
            {
                var asyncCallback = assert.async();

                //Returns a Struct
                boundAsync.returnObject('CefSharp Struct Test').then(function (actualResult)
                {
                    const expectedResult = 'CefSharp Struct Test';

                    assert.equal(expectedResult, actualResult.Value, "Return class " + expectedResult);

                    asyncCallback();
                });                
            });

            QUnit.test( "Class Test:", function( assert )
            {
                var asyncCallback = assert.async();

                //Returns a class
                boundAsync.returnClass('CefSharp Class Test').then(function (actualResult)
                {
                    const expectedResult = 'CefSharp Class Test';

                    assert.equal(expectedResult, actualResult.Value, "Return class " + expectedResult);

                    asyncCallback();
                });                
            });


        })();
        </script>

    </body>
</html>
